<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.minshenglife.zanzan.pub.Config" %>
	<%
	String rootPath = Config.getProperty(Config.WX_BASEURL);//应用的根路径
	%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=rootPath%>">
    
    <title>添加管理员</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  </head>
  
  <body>
  	<table border="1px" style="width: 100%;" > 
  		<tr>
  			<td>员工姓名：${user.emp_name}</td>
  		</tr>
  		<tr>
  			<td>员工职位：${user.posiName}</td>
  		</tr>
  		<tr>
  			<td>职位全称：${dept_name}</td>
  		</tr>
  		<tr>
  			<td>员工职级：${user.postId}</td>
  		</tr>
  	</table>
    <form action="<%=rootPath%>/userLogin/insertManager.power" id="fromId" method="post" > 
    	员工号<input type="text" onblur="valiempId()" value="${user.empId}" disabled="disabled"/><br>
    		<input type="hidden" name="empId"  value="${user.empId}"/>
    	登陆密码<input type="password" name="passWord" id="passWord"/><br>
    	管理区域<select id="dept_id" name="dept_id">
    			
    		 	</select>
				<%--
    	管理职级<select id="postId" name="postId">  
				  <option value="">请选择等级</option>
				  <option value="S">S等级</option>   
				  <option value="A">A等级</option>  
				  <option value="B">B等级</option>  
				  <option value="C">C等级</option>  
				  <option value="D">D等级</option>
				  <option value="E">E等级</option>    
				</select>
				
			--%><input type="button" value="保存" onclick="fromSubmit();" id='fromsubmit'/>
    </form>
  </body>
</html>
<script type="text/javascript" src="<%=rootPath%>/jsp/power/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
	$(function(){
		var dept_id = 1;
		$.ajax({
			url:"<%=rootPath%>/userRole/lodedeptSheng.power",
			type: 'GET',
			dataType: "JSON",
			data:'dept_id='+dept_id,
			async: false,
			success: function (obj){
				var str = "<option value=''>选择机构</option>";
				for(var i=0;i<obj.data.length;i++){
					str+="<option value='"+obj.data[i].dept_id+"'>"+obj.data[i].abbr_name+"</option>";
				}
				$("#dept_id").html(str);
			}
		})
	})
	function valiPassWord(){
		if($("#passWord").val()){
			return true;
		}else{
			alert("请输入密码");
			return false;
		}
	}
	
	function fromSubmit(){
		if(valiPassWord()){
			$("#fromId").submit();
		}else{
			
		}
	}
</script>
